package cn.gene.timeyan.ums.webapi.ums.controller;


import cn.gene.timeyan.common.restful.JsonResult;
import cn.gene.timeyan.ums.service.ISearchRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 搜索记录信息 前端控制器
 * </p>
 *
 * @author LWG
 * @since 2022-08-06
 */
@RestController
@RequestMapping("/search-record")
@Api(tags = "搜索记录")
public class SearchRecordController {
    @Autowired
    private ISearchRecordService iSearchRecordService;
    @GetMapping("/all")
    @ApiOperation("获取用户搜索记录")
    @ApiImplicitParam(value = "用户ID",name = "userId",dataType = "Long",
            required = true)
    public JsonResult<List> getAllRecord(Long userId){
        List list=iSearchRecordService.getRecord(userId);
        return JsonResult.ok(list);
    }
}

